gl: Move vfunc
authorBenjamin Otte <otte@redhat.com>
Wed, 7 Jul 2021 02:40:34 +0000 (04:40 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 22 Jul 2021 14:27:32 +0000 (16:27 +0200)
commit9f1d6e1f4474707aa9931660da6c3154b2281705
tree3c3a08a86fab2fa8d3f56f2c805e5c15b800f9de
parent15ed1a329e2f4939b239d0845f3200df1cdcdd7e
gl: Move vfunc

Instead of
  Display::make_gl_context_current()
we now have
  GLContext::clear_current()
  GLContext::make_current()

This fits better with the backends (we can actually implement
clearCurrent on macOS now) and makes it easier to implement different GL
backends for backends (like EGL/GLX on X11).

We also pass a surfaceless boolean to make_current() so the calling code
can decide if a surface needs to be bound or not, because the backends
were all doing whatever, which was very counterproductive.
18 files changed:
gdk/gdkdisplay.c
gdk/gdkdisplayprivate.h
gdk/gdkglcontext.c
gdk/gdkglcontextprivate.h
gdk/macos/gdkmacosdisplay.c
gdk/macos/gdkmacosglcontext-private.h
gdk/macos/gdkmacosglcontext.c
gdk/wayland/gdkdisplay-wayland.c
gdk/wayland/gdkglcontext-wayland.c
gdk/wayland/gdkglcontext-wayland.h
gdk/win32/gdkdisplay-win32.c
gdk/win32/gdkglcontext-win32.c
gdk/win32/gdkglcontext-win32.h
gdk/x11/gdkdisplay-x11.c
gdk/x11/gdkglcontext-egl.c
gdk/x11/gdkglcontext-glx.c
gdk/x11/gdkglcontext-x11.c
gdk/x11/gdkglcontext-x11.h